package com.krmes.mes;

import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.RadioGroup;
import android.widget.RadioGroup.OnCheckedChangeListener;

import com.krmes.mes.base.BaseFragment;
import com.krmes.mes.wiget.SegmentedRadioGroup;

public class FragmentStartData
        extends BaseFragment
        implements OnCheckedChangeListener
{
    SegmentedRadioGroup segment;

    public void onCheckedChanged(RadioGroup group, int checkedId)
    {
        if(group == segment) {
            if(checkedId == R.id.btn_day) {

                loadFragment(new FragmentDisplayData());
                return;
            }
            //查询进行中的任务
            if(checkedId == R.id.btn_month) {
                loadFragment(new FragmentDisplayData2());
                return;
            }
            if(checkedId == R.id.btn_year) {
                loadFragment(new FragmentDisplayData3());
                return;
            }
        }
    }

    public View onCreateView(LayoutInflater paramLayoutInflater, ViewGroup paramViewGroup, Bundle paramBundle)
    {
        View localView = paramLayoutInflater.inflate(R.layout.fragment_startdata, paramViewGroup, false);//
        this.segment = ((SegmentedRadioGroup)localView.findViewById(R.id.segment));
        this.segment.setOnCheckedChangeListener(this);
        loadFragment(new FragmentDisplayData());
        return localView;
    }
}
